/**
 * 
 */
package org.sensmon.core.datamodel;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Timer;

import org.sensmon.core.datamodel.filters.RunnableFilter;

/**
 * @author LAP
 *
 */
public class RequestThread {
	private RunnableFilter<Double> filter;
	private LTR11Device device;
	private Timer timer = new Timer(1000, new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			filter.addValue(device.getData().get());
		}
	});
	
	public RequestThread(RunnableFilter<Double> filter, LTR11Device device) {
		this.filter = filter;
		this.device = device;
	}
	
	public void start() {
		timer.start();
	}
}
